<template>
  <div class="bonus-config">
    <dt-grid ref="table" :columns="columns" :onFetch="onFetch" />
    <edit-page ref="edit" @success="onSuccess" />
  </div>
</template>
<script>
  import columnOpt from './opt/column.js'
  import apiMgr from '@/biz/bonus/bonusDateConfig.js'
  import editPage from './components/edit.vue'
  export default {
    data() {
      return {
        columns: []
      }
    },
    components: {
      editPage
    },
    mounted() {
      this.$refs.table.init(this, new columnOpt(this))
      this.$refs.table.init(this)
      this.$refs.table.fetch()
    },

    methods: {
      onSuccess() {
        this.$refs.table.fetch()
      },
      onFetch(data) {
        return apiMgr.getBoDateSettingInfo(data).then((res) => {
          return res
        })
      },
      //编辑
      editFun(row) {
        this.$refs.edit.show(row)
      }
    }
  }
</script>

<style lang="scss" scoped>
  .bonus-config {
    padding: 20px;
  }
</style>
